<template>
  <div id="app">
    <!--测试vue-awesome-swiper-->
    <!--<swiper ref="mySwiper" :options="swiperOptions">
      <swiper-slide>
        <img src="/images/floor-1-b01.png" alt="">
      </swiper-slide>
      <swiper-slide>
        <img src="/images/floor-1-b02.png" alt="">
      </swiper-slide>
      <swiper-slide>
        <img src="/images/floor-1-b03.png" alt="">
      </swiper-slide>
      <div class="swiper-pagination" slot="pagination"></div>
    </swiper>-->
    <sph-header></sph-header>
    <router-view></router-view>
    <sph-footer v-show="!$route.meta.hideFooter"></sph-footer>
  </div>
</template>

<script>
  import header from "components/header/header"
  import footer from "components/footer/footer"
  import { Swiper, SwiperSlide } from 'vue-awesome-swiper'
  import {mapActions} from "vuex";
  export default {
    name: 'App',
    data() {
      return {
        swiperOptions: {
          loop:true,
          pagination: {
            el: '.swiper-pagination'
          }
        }
      }
    },
    methods:{
      ...mapActions(["getBaseCategoryList","getBanners","getFloors"]),
    },
    components:{
      "sph-header":header,
      "sph-footer":footer,
      Swiper,
      SwiperSlide
    },
    async created(){
      //自动登陆  校验token是否合法!! 如果合法保持登陆状态  如果不合法则退出登录
      // await this.autoLogin()
    },
    async mounted() {
      //转发action 发送请求获取数据 提交mutation 最后修改仓库的数据
      await this.getBaseCategoryList();
      await this.getBanners();
      await this.getFloors()
    }
  }



</script>

<style scoped>

</style>
